proper, published library, which is now tagged as v1.0.0.
* A new message (defaulting to blank), 'editnotice-notext', can be shown to users
when they are editing if no edit notices apply to the page being edited.
+* (T94536) You can now make the sitenotice appear to logged-in users only by
+ editing MediaWiki:Anonnotice and replacing its content with "". Setting it to
+ "-" (default) will continue disable it and fallback to MediaWiki:Sitenotice.
==== External libraries ====
* MediaWiki now requires certain external libraries to be installed. In the past
* Get a cached notice
*
* @param string $name Message name, or 'default' for $wgSiteNotice
- * @return string HTML fragment
+ * @return string|bool HTML fragment, or false to indicate that the caller
+ * should fall back to the next notice in its sequence
*/
private function getCachedNotice( $name ) {
global $wgRenderHashAppend, $parserMemc, $wgContLang;
}
} else {
$msg = $this->msg( $name )->inContentLanguage();
- if ( $msg->isDisabled() ) {
+ if ( $msg->isBlank() ) {
+ return '';
+ } elseif ( $msg->isDisabled() ) {
return false;
}
$notice = $msg->plain();
$siteNotice = $this->getCachedNotice( 'sitenotice' );
} else {
$anonNotice = $this->getCachedNotice( 'anonnotice' );
- if ( !$anonNotice ) {
+ if ( $anonNotice === false ) {
$siteNotice = $this->getCachedNotice( 'sitenotice' );
} else {
$siteNotice = $anonNotice;
}
}
- if ( !$siteNotice ) {
+ if ( $siteNotice === false ) {
$siteNotice = $this->getCachedNotice( 'default' );
}
}